<template>
	<view>
		<image src="../../static/my/topImage.png" mode="widthFix" style="width: 100%;"></image>
		<view class="bgView">
			<view class="headView flex-row-flex-start">
				<image class="head" src="/static/my/head.png" mode=""></image>
				<view class="">
					<view class="phone">
						{{userinfo.mobile}}
					</view>
					<view class="label flex-column-center">
						<text v-if="Number(userinfo.is_open)==0">未开户</text>
						<text v-if="Number(userinfo.is_open)==1">已开户</text>
						<text v-if="Number(userinfo.is_open)==2">待审核</text>
					</view>
				</view>
			</view>
			<view class="bgView1 flex-row-space-between">
				<view @click="toUrl('withdrawalRecord')" class="bgView2 flex-column-center">
					<image class="image11" src="/static/my/11.png" mode=""></image>
					<view class="title">
						提现记录
					</view>
				</view>
				<view @click="toImproveInfo()" class="bgView3 flex-column-center">
					<image class="image11" src="/static/my/12.png" mode=""></image>
					<view class="title">
						提升额度
					</view>
				</view>
			</view>
		</view>
		<view v-for="(item,index) in list" :key="index">
			<view @click="itemClick(item)" class="item flex-row-space-between">
				<view class="flex-row-flex-start">
					<image class="icon" :src="item.icon" mode=""></image>
					<view class="name">
						{{item.name}}
					</view>
				</view>
				<image class="arrow" src="/static/common/arrow.png" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapActions,
		mapState
	} from "vuex";
	import {
		info,
	} from '@/api/index.js'
	export default {
		components: {},
		computed: {

		},
		data() {
			return {
				userinfo:{},
				list:[{
					name:'资料完善',
					icon:'/static/my/1.png',
					
					url:'/pages/index/improveInfo'
				},
				{
					name:'我的消息',
					icon:'/static/my/2.png',
					url:'message'
				},
				{
					name:'关于我们',
					icon:'/static/my/3.png',
					url:'/pages/login/richText?title=关于我们'
				},
				
				{
					name:'帮助中心',
					icon:'/static/my/4.png',
					url: "/pages/my/help"
				},
				{
					name:'意见反馈',
					icon:'/static/my/5.png',
					url:'/pages/my/feedback'
				},
				{
					name:'安全退出',
					icon:'/static/my/6.png',
					url:'/pages/my/setUp'
				}
				],
				data:{}

			}
		},
		computed: {
			...mapState([
				'baseColor'
			]),
		},
		onShow() {
			this.info()
		},
		onLoad(e) {
			// this.loadData()
		},
		//下拉刷新
		onPullDownRefresh() {


		},
		//加载更多
		onReachBottom() {

		},
		onPageScroll(e) {
			// if (e.scrollTop > 20) {
			// 	this.backgroundColor = "#FBF9FF"
			// } else {
			// 	this.backgroundColor = "#ffffff00"
			// }
		},
		methods: {
			toImproveInfo(){
				if(Number(this.userinfo.is_open)==1){
					uni.switchTab({
						url:'/pages/index/index'
					})
				}else{
					this.toUrl('/pages/index/improveInfo')
				}
			},
			
			info () {
			
				var data = {
				
				}
				info(data).then(res => {
					this.userinfo=res.data
				})
			},
			loadData () {
			
				var data = {
				id:this.id
				}
				forum_list(data).then(res => {
					this.list=res.data.data
				})
			},
			itemClick(item){
				this.toUrl(item.url)	
			},
			showToast(title) {
				uni.showToast({
					title: title,
					icon: 'none'
				})
			},
			toUrl(url) {
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style lang="scss">
.bgView{
	margin: 30rpx;
	position: relative;
	margin-top: -340rpx;
}
.head{
	margin-right: 12rpx;
	width: 136rpx;
	height: 136rpx;
}
.phone{
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 34rpx;
	color: #FFFFFF;
}
.label{
	margin-top: 10rpx;
	width: 100rpx;
	height: 40rpx;
	background: rgba(234,236,238,0.2);
	border-radius: 24rpx 24rpx 24rpx 24rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 26rpx;
	color: #FFFFFF;
}
.bgView1{
	padding: 0 30rpx;
	margin-top: 40rpx;
	height: 252rpx;
	background: #FFFFFF;
	border-radius: 24rpx 24rpx 24rpx 24rpx;
}
.bgView2{
	width: 300rpx;
	height: 144rpx;
	background: linear-gradient( 360deg, #FF587C1A 0%, rgba(255,88,124,0.1) 10%);
	border-radius: 24rpx 24rpx 24rpx 24rpx;
	// opacity: 0.1;
}
.image11{
	margin-top: -80rpx;
	width: 92rpx;
	height: 92rpx;
}
.title{
	// margin-top: 20rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 30rpx;
	color: #797979;
}
.bgView3{
	width: 300rpx;
	height: 144rpx;
	background: linear-gradient( 360deg, #F583461A 0%, rgba(245,131,70,0.1) 10%);
	border-radius: 24rpx 24rpx 24rpx 24rpx;

}
.item{
	padding: 0 30rpx;
	margin: 20rpx;
	height: 116rpx;
	background: #FFFFFF;
	border-radius: 24rpx 24rpx 24rpx 24rpx;
}
.icon{
	width: 44rpx;
	height: 44rpx;
}
.name{
	margin-left: 10rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 30rpx;
	color: #16171B;
}
</style>